//引入axios
import request from '@/utils/request.js';

//删除班级账单
export function deleteClassbill(id) {
    const url  = `classAccounts/${id}`;
    return request({
        url: url,
        method: 'delete',
        data: '',
        headers: {
        'Content-Type': 'application/json',
        addToken: true      // 指示需要在请求头中添加 token
        }
    })
}

//修改班级账单
export function uploadClassbill(id,data) {
    const url  = `classAccounts/${id}`;
    return request({
        url: url,
        method: 'put',
        data: data,
        headers: {
        'Content-Type': 'application/json',
        addToken: true      // 指示需要在请求头中添加 token
        }
    })
}

  //查询班级账单
export function checkClassbill(classCode) {
    const url  = `classAccounts/${classCode}`;
    return request({
      url: url,
      method: 'get',
      params: '',
      headers: {
        'Content-Type': 'application/json',
        addToken: true      // 指示需要在请求头中添加 token
      }
    })
}

//获取用户信息
export function getUsersinfo() {
    const id = localStorage.getItem('UserId');
    const url  = `users/${id}`;
    return request({
      url: url,
      method: 'get',
      params: '',
      headers: {
          'Content-Type': 'application/json',
          addToken: true      // 指示需要在请求头中添加 token
        }
    })
  }
